<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>父子元素之间-上外边距合并（穿透）</title>
    <style>
      * {
        padding: 0;
        margin: 0;
      }
      .box {
        width: 200px;
        height: 200px;
        background-color: yellowgreen;
        margin-top: 20px;
      }
      .item {
        width: 100px;
        height: 100px;
        background-color: skyblue;
        margin-top: 50px;
      }
    </style>
  </head>
  <body>
    <div class="box">
      <div class="item"></div>
    </div>
  </body>
</html>
